#pragma once
#include "SDLSprite.h"
#include "CppTweener.h"
#include "SDLTimer.h"

class SpriteEasing : SDLComponent
{
public:
	SpriteEasing();
	~SpriteEasing();

	//enum kindEasing{LINEAR = 0, SINE, Quint, Quart, Quad, Expo, Elastic, Cubic, Circ, Bounce, Back};
	//enum easingFunction{EASEIN = 0, EASEOUT, EASEINOUT};

	SpriteEasing(tween::kindEasing kindAnim, tween::easingFunction kindFunc, long duration);

	void StartTweenAnim(SpriteEasing* secondTween, SDLSprite* linkSprite, float endValueX, float endValueY, float nextEndValueX, float nextEndValueY);

	void StartTweenAnim(SDLSprite* linkSprite, float endValueX, float endValueY);
	void StartTweenAnimScale(SDLSprite* linkSprite, float beginMultiplicator, float endMultiplicator);
	void StopTweenAnim();

	 void Start(){}
	 void Stop(){}
	 void Draw(){}

	 void Update();

private:
	tween::Tweener tweener;
	tween::TweenerParam param;

	SDLSprite* linkSprite;
	int kindAnim;
	int kindFunc;
	float endValueX;
	float endValueY;
	long duration;

	float currentTime;
	bool canStop;
	bool isScale;

	bool animating;

	float posX;
	float posY;

	float scaleMultiplicator;

	float secondEndValueX;
	float secondEndValueY;
	SpriteEasing* theSecondTween;

};

